package lab02.test25;

import java.util.Scanner;

import java.io.*;

public class Test25 {
    public static void main(String[] args) {
        /*
        double num=0;
        try{
            num=1/0;
            System.out.println(num);
        }
        catch (ArithmeticException e){
            e.printStackTrace();
        }
        */


        try {
            System.out.println("请输入两个数：");

            Scanner sc = new Scanner(System.in);

            int a = sc.nextInt();
            int b = sc.nextInt();

            int c = a / b;

            System.out.println(c);
//            double a = sc.nextDouble();
//            double b = sc.nextDouble();
//
//            double c = 0;
//
//            c = a / b;
//
//            System.out.println("商为：" + c);
        } catch (ArithmeticException e) {
            System.out.println("0不能作为除数");
            e.printStackTrace();

        } catch (Exception e) {
            System.out.println("0不能作为除数");
            e.printStackTrace();
        }


    }
//
//    private static double divide(double a, double b) throws Exception {
//        if (b == 0) {
//            Exception e = new Exception("除数为零");
//            throw e;
//        }
//        return a / b;
//    }
}


